]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellApp: Use stable sequence for id, not pointer address
authorColin Walters <walters@verbum.org>
Thu, 11 Aug 2011 09:47:38 +0000 (05:47 -0400)
committerColin Walters <walters@verbum.org>
Thu, 11 Aug 2011 09:47:38 +0000 (05:47 -0400)
As danw points out,

  "It's unique during the lifetime of the window, but reasonably likely to be
  reused by another window after this one is destroyed. Using
  meta_window_get_stable_sequence() might be better."

https://bugzilla.gnome.org/show_bug.cgi?id=648149

src/shell-app.c

index b6ff31bc3d97ccb12d7d67d32a80105f8e21efaf..1ff98942980da886fa666bb779825f1a2ab30145 100644 (file)
@@ -777,11 +777,7 @@ _shell_app_new_for_window (MetaWindow      *window)
 
   app = g_object_new (SHELL_TYPE_APP, NULL);
 
-  /* For windows, its id is simply its pointer address as a string.
-   * There are various other alternatives, but the address is unique
-   * and unchanging, which is pretty much the best we can do.
-   */
-  app->window_id_string = g_strdup_printf ("window:%p", window);
+  app->window_id_string = g_strdup_printf ("window:%d", meta_window_get_stable_sequence (window));
 
   _shell_app_add_window (app, window);